from pathlib import Path
import requests

DATA_PATH = Path("data")
PATH = DATA_PATH / 'minst'

PATH.mkdir(parents=True, exist_ok=True)

URL = 'http://deeplearning.net/data/mnist'
FILENAME = 'mnist.pkl.gz'

if not (PATH / FILENAME).exists():
  content = requests.get(URL + FILENAME).content
  (PATH /FILENAME).open('wb').write(content)